package com.store.service.impl;

import com.store.entity.DictDistrict;
import com.store.mapper.DictDistrictMapper;
import com.store.service.IDictDistrictService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author cai
 * @since 2022-07-12
 */
@Service
public class DictDistrictServiceImpl extends ServiceImpl<DictDistrictMapper, DictDistrict> implements IDictDistrictService {

    @Autowired
    DictDistrictMapper districtMapper;
    @Override
    public List<DictDistrict> selectByParent(String parent) {
        List<DictDistrict> list= districtMapper.selectByParent(parent);
        for (DictDistrict district : list) {
            district.setId(null);
            district.setParent(null);
        }
        return list;
    }
}
